package org.example;
import java.util.*;
/**
 * 作者:TC
 * 时间:2023/12/8 14:33
 * 描述:没有bug
 */
public class Player {
private String id;//ID
private String  name;//名字
private List<Mission>MissionList;//任务列表
private int x;//玩家当前坐标x
private int y;//玩家当前坐标y
//构造函数
    public Player(String id, String name, int x, int y) {
        this.id = id;
        this.name = name;
        this.MissionList=new ArrayList<>();
        this.x = x;
        this.y = y;
    }
    //添加任务到集合MissionList列表中,传入mission的任务
    public void addMission(Mission mission)
    {
        MissionList.add(mission);
    }
    //getter函数和setter函数
public void arriveMission(int x,int y){
    System.out.println("玩家"+getName()+"到达任务点("+x+","+y+")");
    this.x=x;
    this.y=y;
}
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Mission> getMissionList() {
        return MissionList;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}
